package com.khh.mapper;

import com.khh.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-09-11.
 */
@Service
public interface StudentMapper {

    @Select("select * from student")
    public List<Map<String,Object>> queryAll();

    public Map<String,Object> queryById(int id);

    @Insert("insert into student (name,score,age) values(#{name},#{score},#{age})")
    public int insert(Map<String,Object> map);

    @Delete("delete from student where id=#{id}")
    public int deleteById(int id);


    @Insert("insert into student (name,score,age) values(#{name},#{score},#{age})")
    public int inserts(Student stu);
}
